# Definition for a binary tree node.
class TreeNode(object):
    def __init__(self, x):
        self.val = x
        self.left = None
        self.right = None

class Solution(object):
    def increasingBST(self, root):
        """
        :type root: TreeNode
        :rtype: TreeNode
        """

        ans = self.cur = TreeNode(0)
        return ans.right

    def find(self,root):
        if not root:
            return None

        self.find(root.left)
        self.cur.right = root
        self.cur = root

        self.find(root.right)

